package com.stars.ctl;

import com.github.pagehelper.PageInfo;
import com.stars.common.base.BaseMsg;
import com.stars.common.base.ResultMsg;
import com.stars.dao.dto.TestDTO;
import com.stars.entity.TestEntity;
import com.stars.services.TestAccessServices;
import com.stars.services.TestConfigServices;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName TestCtl
 * @Description:
 * @Author DJ
 * @Date 2019/12/26
 * @Version V1.0
 **/
@RestController
@RequestMapping("/testCtl")
public class TestCtl {
    @Autowired
    private TestAccessServices testAccessServicesImpl;
    @Autowired
    private TestConfigServices testConfigServicesImpl;

    @GetMapping("/pageList")
    @ApiOperation(value =  BaseMsg.MODULAR_PAGE,notes = BaseMsg.MODULAR_PAGE)
    public PageInfo<TestDTO> pagePasCompanyInfoList(Integer pageNum, Integer pageSize, TestDTO dto, HttpServletRequest request) throws Exception{
        return testAccessServicesImpl.pageList(pageNum,pageSize,dto);

    }
    @PostMapping("/addTest")
    @ApiOperation(value =  BaseMsg.MODULAR_ADD,notes = BaseMsg.MODULAR_ADD)
    public ResultMsg addTest(TestEntity dto) throws Exception{
        return testConfigServicesImpl.insertSelective(dto);

    }


}
